package com.xr.system.service.impl;

import com.xr.system.common.base.MyPage;
import com.xr.system.common.base.MyServiceImpl;
import com.xr.system.entity.dictionaryModule.Dictionary;
import com.xr.system.mapper.DictionaryMapper;
import com.xr.system.service.DictionaryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 字典表 (Dictionary)表服务实现类
 */
@Service("dictionaryService")
public class DictionaryServiceImpl extends MyServiceImpl<DictionaryMapper, Dictionary> implements DictionaryService {

	/**
	 * 通过父字典code 查询子集
	 * @param code 父字典code
	 * @return
	 */
	@Override
	public List<Dictionary> listDicByParentCode(String code) {
		return baseMapper.listDicByParentCode(code);
	}

	/**
	 * 分页查询所有数据
	 * @param page 分页对象
	 * @return
	 */
	@Override
	public MyPage<Dictionary> queryByPage(MyPage<Dictionary> page, Dictionary dictionary) {
		return baseMapper.queryByPage(page, dictionary);
	}

}
